package cn.com.nthotline.activity;

import cn.com.nthotline.R;
import android.app.Activity;
import android.app.ActivityManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

public class SplashActivity extends Activity {
	private static final int DELAY_TIME = 2000;
//	ActivityManager mActivityManager;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_splash);
		new Handler().postDelayed(new Runnable() {

			@Override
			public void run() {
				// TODO Auto-generated method stub
				startAct();
			}
		}, DELAY_TIME);
//		mActivityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
//		new PrintThread().start();
	}

	private void startAct() {
		Intent intent = new Intent();
		intent.setClass(SplashActivity.this, MainTabActivity.class);
		startActivity(intent);
		finish();
	}
	
//	class PrintThread extends Thread {
//		@Override
//		public void run() {
//			// TODO Auto-generated method stub
//			super.run();
//			while (true) {
//				ComponentName componentName = mActivityManager.getRunningTasks(1).get(0).topActivity;
//				String packageName = componentName.getPackageName();
//				String className = componentName.getClassName();
//				System.out.println("package = " + packageName + ", class = " + className);
//				try {
//					Thread.sleep(15000);
//				} catch (InterruptedException e) {
//					// TODO Auto-generated catch block
//					e.printStackTrace();
//				}
//			}
//		}
//	}
}
